package com.achobeta.recruitment.service.student;

import com.achobeta.recruitment.model.StudentInfoWithBLOBs;
import com.achobeta.recruitment.model.vo.StudentInfoVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 马拉圈
 * Date: 2023-10-30
 * Time: 16:41
 */
public interface StudentInfoService {

    /**
     * 创建一张student info白纸
     * @param openid 学生openid
     */
    void initStudentInfo(String openid);

    /**
     * 保存草稿
     */
    void saveStudentInfo(StudentInfoWithBLOBs studentInfo);


    /**
     * 通过openid查询student信息
     * @param openid openid
     * @return
     */
    StudentInfoWithBLOBs selectStudentInfoByOpenId(String openid, Byte state);

    /**
     * 提交简历
     * @param studentInfo
     */
    @Transactional// 三次写操作
    void submitStudentInfo(StudentInfoWithBLOBs studentInfo);

    /**
     * 保存文件
     * @param file
     * @param path
     */
    void loadImage(MultipartFile file, String path);

    /**
     * 根据openid，获取超详细的用户相关信息
     * @param openid
     * @return
     */
    StudentInfoVO selectDetailStudentInfoByOpenid(String openid);

    /**
     * 修改状态以及学生信息
     * @param studentInfoWithBLOBs
     * @param stateId
     */
    @Transactional
    void updateInfo(StudentInfoWithBLOBs studentInfoWithBLOBs, Byte stateId);


}
